package com.ndp.fb.rdb.model;

import com.ndp.fb.rdb.annotation.Column;
import com.ndp.fb.rdb.annotation.Id;
import com.ndp.fb.rdb.annotation.Table;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * Created by Elvis on 14-10-18.
 */
@Setter
@Getter
@NoArgsConstructor
@Table("changehistory")
public class ChangeAccountHistory implements Serializable {
    private static final long serialVersionUID = -6914911429364912939L;
    /**
     * id
     */
    @Id
    private Long id;
    /**
     * date
     */
    private Long date;
    /**
     * appendAccounts
     */
    @Column("appendAccounts")
    private String appendAccounts;
    /**
     * recycleAccounts
     */
    @Column("recycleAccounts")
    private String recycleAccounts;
    /**
     * userId
     */
    @Column("userId")
    private String userId;

    @Override
    public int hashCode() {
        return id.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (obj instanceof ChangeAccountHistory) {
            ChangeAccountHistory other = (ChangeAccountHistory) obj;
            if (id == null) {
                if (other.id != null) {
                    return false;
                }
            } else if (!id.equals(other.getId())) {
                return false;
            }
        }
        return true;
    }
}
